{extend name='admin@main'}

{block name="button"}
<button  id="refresh" class='layui-btn layui-btn-sm layui-btn-primary'>更新插件</button>
<script>
    $('#refresh').click(function(){
        $.form.load('{:url("@addons/manager-plugs-refresh")}', {}, 'post', function () {
        });
    });
</script>
{/block}

{block name="content"}
<div class="think-box-shadow">
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='text-left nowrap'>ID</th>
            <th class='text-left nowrap'>标题</th>
            <th class='text-left nowrap'>模块</th>
            <th class='text-left nowrap'>描述</th>
            <th class='text-left nowrap'>安装状态</th>
            <th class='text-left nowrap'>安装时间</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>

            <td class='text-left nowrap'>
                {$vo.id|default=''}

            </td>

            <td class='text-left nowrap'>
                {$vo.title|default=''}

            </td>

            <td class='text-left nowrap'>
                {$vo.name|default=''}
            </td>

            <td class='text-left nowrap'>
                {$vo.intro|default=''}

            </td>

            <td class='text-left nowrap'>
                <input type="checkbox" name="install_status" data-switch="{:url('@addons/manager-plugs-switches')}"
                       lay-filter="switch-table-{$vo.id}" data-param="id={$vo.id}" {if $vo.install_status eq 1}checked{/if}
                lay-skin="switch" title="开关">

            </td>

            <td class='text-left nowrap'>
                {$vo.install_time|format_datetime}
            </td>

            <td class='text-left nowrap'>
                {if $vo.install_status}
                <a class="layui-btn layui-btn-primary" data-open="{:url('@addons/manager-plugs-detail')}?name={$vo.name}&type={$vo.type}" type="button">详情</a>
                {/if}
            </td>

        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>

{/block}
